package com.iis.entity;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;

import com.iis.dao.ClientDAO;
import com.iis.dao.SalesmanDAO;

public class Salesman extends Employee {
	
	private long salesmanID;
	private Double salesTarget;
	
	public long getSalesmanID() {
		return salesmanID;
	}
	public void setSalesmanID(long salesmanID) {
		this.salesmanID = salesmanID;
	}
	
	public Double getSalesTarget() {
		return salesTarget;
	}
	public void setSalesTarget(Double salesTarget) {
		this.salesTarget = salesTarget;
	}
	
	public void save(){
		SalesmanDAO mySalesmanDAO = SalesmanDAO.getInstances();
		try {
			mySalesmanDAO.save(this);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static ArrayList<Salesman> getAll() {
		SalesmanDAO mySalesmanDAO = SalesmanDAO.getInstances();
		return mySalesmanDAO.getAll();
	}
	
	public String[] toArray(){
		String[] arr = new String[5];
		arr[0] = String.valueOf(this.getEmployeeNo());
		arr[1] = this.getName();
		arr[2] = this.getSalesTarget().toString();
		return arr;
 	}
	
	
}
